package com.example.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.example.starter.mybatis.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 *
 * @author 王令
 * @since 2022-08-05
 */
@Data
@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
@ToString(callSuper = true)
@Accessors(chain = true)
@TableName(value = "sys_authority", autoResultMap = true)
public class Authority extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 名称
     */
    private String title;

    /**
     * 路由组件name或后端权限编码
     */
    private String name;

    /**
     * 资源类型【0: 菜单，1:后端接口权限】
     */
    private Integer type;

    /**
     * 路径_前端路由
     */
    private String path;

    /**
     * 组件地址(路由组件地址 src为根路径/)
     */
    private String component;


    private Long parentId;

    @TableField(value = "`order`")
    private Integer order;

    /**
     * 重定向
     */
    private String redirect;

    /**
     * 扩展信息
     */
    @TableField(value = "meta", typeHandler = JacksonTypeHandler.class)
    private RouteMeta meta;

}
